Integrand size = 20, antiderivative size = 108 \[ \int (c+d x) \cot ^2(a+b x) \csc (a+b x) \, dx=\frac {(c+d x) \text {arctanh}\left (e^{i (a+b x)}\right )}{b}-\frac {d \csc (a+b x)}{2 b^2}-\frac {(c+d x) \cot (a+b x) \csc (a+b x)}{2 b}-\frac {i d \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{2 b^2}+\frac {i d \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{2 b^2} \]
[Out]
Time = 0.14 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {4500, 4268, 2317, 2438, 4270} \[ \int (c+d x) \cot ^2(a+b x) \csc (a+b x) \, dx=\frac {(c+d x) \text {arctanh}\left (e^{i (a+b x)}\right )}{b}-\frac {i d \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{2 b^2}+\frac {i d \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{2 b^2}-\frac {d \csc (a+b x)}{2 b^2}-\frac {(c+d x) \cot (a+b x) \csc (a+b x)}{2 b} \]
[In]
[Out]
Rule 2317
Rule 2438
Rule 4268
Rule 4270
Rule 4500
Rubi steps \begin{align*} \text {integral}& = -\int (c+d x) \csc (a+b x) \, dx+\int (c+d x) \csc ^3(a+b x) \, dx \\ & = \frac {2 (c+d x) \text {arctanh}\left (e^{i (a+b x)}\right )}{b}-\frac {d \csc (a+b x)}{2 b^2}-\frac {(c+d x) \cot (a+b x) \csc (a+b x)}{2 b}+\frac {1}{2} \int (c+d x) \csc (a+b x) \, dx+\frac {d \int \log \left (1-e^{i (a+b x)}\right ) \, dx}{b}-\frac {d \int \log \left (1+e^{i (a+b x)}\right ) \, dx}{b} \\ & = \frac {(c+d x) \text {arctanh}\left (e^{i (a+b x)}\right )}{b}-\frac {d \csc (a+b x)}{2 b^2}-\frac {(c+d x) \cot (a+b x) \csc (a+b x)}{2 b}-\frac {(i d) \text {Subst}\left (\int \frac {\log (1-x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^2}+\frac {(i d) \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^2}-\frac {d \int \log \left (1-e^{i (a+b x)}\right ) \, dx}{2 b}+\frac {d \int \log \left (1+e^{i (a+b x)}\right ) \, dx}{2 b} \\ & = \frac {(c+d x) \text {arctanh}\left (e^{i (a+b x)}\right )}{b}-\frac {d \csc (a+b x)}{2 b^2}-\frac {(c+d x) \cot (a+b x) \csc (a+b x)}{2 b}-\frac {i d \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b^2}+\frac {i d \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b^2}+\frac {(i d) \text {Subst}\left (\int \frac {\log (1-x)}{x} \, dx,x,e^{i (a+b x)}\right )}{2 b^2}-\frac {(i d) \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{i (a+b x)}\right )}{2 b^2} \\ & = \frac {(c+d x) \text {arctanh}\left (e^{i (a+b x)}\right )}{b}-\frac {d \csc (a+b x)}{2 b^2}-\frac {(c+d x) \cot (a+b x) \csc (a+b x)}{2 b}-\frac {i d \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{2 b^2}+\frac {i d \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{2 b^2} \\ \end{align*}
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(260\) vs. \(2(108)=216\).
Time = 1.94 (sec) , antiderivative size = 260, normalized size of antiderivative = 2.41 \[ \int (c+d x) \cot ^2(a+b x) \csc (a+b x) \, dx=-\frac {d \cot \left (\frac {1}{2} (a+b x)\right )}{4 b^2}-\frac {c \csc ^2\left (\frac {1}{2} (a+b x)\right )}{8 b}-\frac {d x \csc ^2\left (\frac {1}{2} (a+b x)\right )}{8 b}+\frac {c \log \left (\cos \left (\frac {1}{2} (a+b x)\right )\right )}{2 b}-\frac {c \log \left (\sin \left (\frac {1}{2} (a+b x)\right )\right )}{2 b}+\frac {a d \log \left (\tan \left (\frac {1}{2} (a+b x)\right )\right )}{2 b^2}-\frac {d \left ((a+b x) \left (\log \left (1-e^{i (a+b x)}\right )-\log \left (1+e^{i (a+b x)}\right )\right )+i \left (\operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )-\operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )\right )\right )}{2 b^2}+\frac {c \sec ^2\left (\frac {1}{2} (a+b x)\right )}{8 b}+\frac {d x \sec ^2\left (\frac {1}{2} (a+b x)\right )}{8 b}-\frac {d \tan \left (\frac {1}{2} (a+b x)\right )}{4 b^2} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 245 vs. \(2 (92 ) = 184\).
Time = 0.88 (sec) , antiderivative size = 246, normalized size of antiderivative = 2.28
method | result | size |
risch | \(\frac {d x b \,{\mathrm e}^{3 i \left (x b +a \right )}+c b \,{\mathrm e}^{3 i \left (x b +a \right )}+d x b \,{\mathrm e}^{i \left (x b +a \right )}+c b \,{\mathrm e}^{i \left (x b +a \right )}-i d \,{\mathrm e}^{3 i \left (x b +a \right )}+i d \,{\mathrm e}^{i \left (x b +a \right )}}{b^{2} \left ({\mathrm e}^{2 i \left (x b +a \right )}-1\right )^{2}}+\frac {c \,\operatorname {arctanh}\left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b}-\frac {d \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) x}{2 b}-\frac {d \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) a}{2 b^{2}}+\frac {i d \operatorname {polylog}\left (2, {\mathrm e}^{i \left (x b +a \right )}\right )}{2 b^{2}}+\frac {d \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right ) x}{2 b}+\frac {d \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right ) a}{2 b^{2}}-\frac {i d \operatorname {polylog}\left (2, -{\mathrm e}^{i \left (x b +a \right )}\right )}{2 b^{2}}-\frac {d a \,\operatorname {arctanh}\left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}\) | \(246\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 454 vs. \(2 (88) = 176\).
Time = 0.27 (sec) , antiderivative size = 454, normalized size of antiderivative = 4.20 \[ \int (c+d x) \cot ^2(a+b x) \csc (a+b x) \, dx=\frac {2 \, {\left (b d x + b c\right )} \cos \left (b x + a\right ) + {\left (i \, d \cos \left (b x + a\right )^{2} - i \, d\right )} {\rm Li}_2\left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) + {\left (-i \, d \cos \left (b x + a\right )^{2} + i \, d\right )} {\rm Li}_2\left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) + {\left (i \, d \cos \left (b x + a\right )^{2} - i \, d\right )} {\rm Li}_2\left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) + {\left (-i \, d \cos \left (b x + a\right )^{2} + i \, d\right )} {\rm Li}_2\left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - {\left (b d x - {\left (b d x + b c\right )} \cos \left (b x + a\right )^{2} + b c\right )} \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) - {\left (b d x - {\left (b d x + b c\right )} \cos \left (b x + a\right )^{2} + b c\right )} \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) - {\left ({\left (b c - a d\right )} \cos \left (b x + a\right )^{2} - b c + a d\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) - {\left ({\left (b c - a d\right )} \cos \left (b x + a\right )^{2} - b c + a d\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) - \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) + {\left (b d x - {\left (b d x + a d\right )} \cos \left (b x + a\right )^{2} + a d\right )} \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b d x - {\left (b d x + a d\right )} \cos \left (b x + a\right )^{2} + a d\right )} \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) + 2 \, d \sin \left (b x + a\right )}{4 \, {\left (b^{2} \cos \left (b x + a\right )^{2} - b^{2}\right )}} \]
[In]
[Out]
\[ \int (c+d x) \cot ^2(a+b x) \csc (a+b x) \, dx=\int \left (c + d x\right ) \cot ^{2}{\left (a + b x \right )} \csc {\left (a + b x \right )}\, dx \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 762 vs. \(2 (88) = 176\).
Time = 0.35 (sec) , antiderivative size = 762, normalized size of antiderivative = 7.06 \[ \int (c+d x) \cot ^2(a+b x) \csc (a+b x) \, dx=\frac {2 \, {\left (b d x + b c + {\left (b d x + b c\right )} \cos \left (4 \, b x + 4 \, a\right ) - 2 \, {\left (b d x + b c\right )} \cos \left (2 \, b x + 2 \, a\right ) - {\left (-i \, b d x - i \, b c\right )} \sin \left (4 \, b x + 4 \, a\right ) - 2 \, {\left (i \, b d x + i \, b c\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) + 1\right ) - 2 \, {\left (b c \cos \left (4 \, b x + 4 \, a\right ) - 2 \, b c \cos \left (2 \, b x + 2 \, a\right ) + i \, b c \sin \left (4 \, b x + 4 \, a\right ) - 2 i \, b c \sin \left (2 \, b x + 2 \, a\right ) + b c\right )} \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) - 1\right ) + 2 \, {\left (b d x \cos \left (4 \, b x + 4 \, a\right ) - 2 \, b d x \cos \left (2 \, b x + 2 \, a\right ) + i \, b d x \sin \left (4 \, b x + 4 \, a\right ) - 2 i \, b d x \sin \left (2 \, b x + 2 \, a\right ) + b d x\right )} \arctan \left (\sin \left (b x + a\right ), -\cos \left (b x + a\right ) + 1\right ) - 4 \, {\left (i \, b d x + i \, b c + d\right )} \cos \left (3 \, b x + 3 \, a\right ) - 4 \, {\left (i \, b d x + i \, b c - d\right )} \cos \left (b x + a\right ) - 2 \, {\left (d \cos \left (4 \, b x + 4 \, a\right ) - 2 \, d \cos \left (2 \, b x + 2 \, a\right ) + i \, d \sin \left (4 \, b x + 4 \, a\right ) - 2 i \, d \sin \left (2 \, b x + 2 \, a\right ) + d\right )} {\rm Li}_2\left (-e^{\left (i \, b x + i \, a\right )}\right ) + 2 \, {\left (d \cos \left (4 \, b x + 4 \, a\right ) - 2 \, d \cos \left (2 \, b x + 2 \, a\right ) + i \, d \sin \left (4 \, b x + 4 \, a\right ) - 2 i \, d \sin \left (2 \, b x + 2 \, a\right ) + d\right )} {\rm Li}_2\left (e^{\left (i \, b x + i \, a\right )}\right ) + {\left (-i \, b d x - i \, b c + {\left (-i \, b d x - i \, b c\right )} \cos \left (4 \, b x + 4 \, a\right ) - 2 \, {\left (-i \, b d x - i \, b c\right )} \cos \left (2 \, b x + 2 \, a\right ) + {\left (b d x + b c\right )} \sin \left (4 \, b x + 4 \, a\right ) - 2 \, {\left (b d x + b c\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} + 2 \, \cos \left (b x + a\right ) + 1\right ) + {\left (i \, b d x + i \, b c + {\left (i \, b d x + i \, b c\right )} \cos \left (4 \, b x + 4 \, a\right ) - 2 \, {\left (i \, b d x + i \, b c\right )} \cos \left (2 \, b x + 2 \, a\right ) - {\left (b d x + b c\right )} \sin \left (4 \, b x + 4 \, a\right ) + 2 \, {\left (b d x + b c\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} - 2 \, \cos \left (b x + a\right ) + 1\right ) + 4 \, {\left (b d x + b c - i \, d\right )} \sin \left (3 \, b x + 3 \, a\right ) + 4 \, {\left (b d x + b c + i \, d\right )} \sin \left (b x + a\right )}{-4 i \, b^{2} \cos \left (4 \, b x + 4 \, a\right ) + 8 i \, b^{2} \cos \left (2 \, b x + 2 \, a\right ) + 4 \, b^{2} \sin \left (4 \, b x + 4 \, a\right ) - 8 \, b^{2} \sin \left (2 \, b x + 2 \, a\right ) - 4 i \, b^{2}} \]
[In]
[Out]
\[ \int (c+d x) \cot ^2(a+b x) \csc (a+b x) \, dx=\int { {\left (d x + c\right )} \cot \left (b x + a\right )^{2} \csc \left (b x + a\right ) \,d x } \]
[In]
[Out]
Timed out. \[ \int (c+d x) \cot ^2(a+b x) \csc (a+b x) \, dx=\text {Hanged} \]
[In]
[Out]